export const getTokenExpTime = (token:string) => {
    try {
        return JSON.parse(atob(token.split('.')[1])).exp as number | undefined
    } catch {
        return undefined
    }
}
export const getToken = () => {
    return localStorage.getItem('token')
}
export const isExp = (expTime:number) => {
    const nowTime = Date.parse(new Date().toString()) / 1000
    return expTime < nowTime
}